import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        int[] array = new int[]{27,15,19,18,28,34,65,49,25,37,27,15,19,18,28,34,65,49,25,37};
        TestHeap testHeap = new TestHeap();
        testHeap.init(array);
        System.out.println("===========大根堆==========");
        testHeap.createdBigHeap();
        System.out.println(Arrays.toString(testHeap.getElem()));
        System.out.println("===========添加一个数100==========");
        testHeap.offerBig(100);
        System.out.println(Arrays.toString(testHeap.getElem()));
        System.out.println("===========删除一个数==========");
        System.out.println("删除的数为"+testHeap.pollBig());
        System.out.println(Arrays.toString(testHeap.getElem()));
        System.out.println("===========获取第k小的数==========");
        System.out.println(Arrays.toString(array));
        System.out.println("第3小的数为"+testHeap.kMinHeap(array, 3));
        System.out.println("===========获取前k个小的数==========");
        System.out.println(Arrays.toString(array));
        System.out.println("前3个小的数为"+Arrays.toString(testHeap.kMinHeapArr(array, 3)));
        System.out.println("===========堆排序--从小到大==========");
        testHeap.heapSort();
        System.out.println(Arrays.toString(testHeap.getElem()));
        System.out.println("===========小根堆==========");
        testHeap.createdSmallHeap();
        System.out.println(Arrays.toString(testHeap.getElem()));
        System.out.println("===========添加一个数1==========");
        testHeap.offerSmall(1);
        System.out.println(Arrays.toString(testHeap.getElem()));
        System.out.println("===========删除一个数==========");
        System.out.println("删除的数为"+testHeap.pollSmall());
        System.out.println(Arrays.toString(testHeap.getElem()));
    }
}